import axios from "./config.js"

// 定义请求接口
// 登入
export const loginApi = (username, password) => axios.post("/api/users/login", {
    username,
    password
})

// 获取验证码
export const getCaptchaApi = () => axios.get("/api/users/getCaptcha")

// 校验验证码
export const verifyCaptchaApi = (captcha) => axios.get("/api/users/verifyCaptcha", {
    params: {
        captcha
    }
})

// 刷新验证码
export const refreshCaptchaApi = () => axios.get("/api/users/refreshCaptcha")

// 获得二维码
export const getScanCodeUrlApi = () => axios.get("/api/users/getScancode")

// 微信登录
export const weChatLoginApi = (wechatCode) => axios.get("/api/users/wechatLogin", {
    params: {
        wechatCode
    }
})

// 登录日志
export const getLoginLogApi = (page = 1, count = 10) => axios.get("/api/getloginlog", {
        params: {
            page,
            count
        }
    })
    // 获取权限菜单=>这个接口一定是在用户登入之后才能获取
export const getMenuListApi = () => axios.get("/api/permission/getMenuList")

// 获取班级列表
export const getClassListApi = () => axios.get("/api/students/getclasses")

// 获取学员信息
export const getStuListApi = (page = "", count = 5, classes = "") => axios.get("/api/students/getstulist", {
        params: {
            page,
            count,
            class: classes
        }
    })
    // 增加学员列表
export const addStuApi = (stuInfo) => axios.post("/api/students/addstu", stuInfo)

// 编辑成员信息接口
export const editStuApi = (stuInfo) => axios.post("/api/students/updatestu", stuInfo)

// 删除成员信息

export const delStuApi = (sId) => axios.get("/api/students/delstu", {
    params: {
        sId
    }
})


// 期望课程api
export const getExpectApi = () => axios.get("/data/expect.json")

// 折线图数据
export const getLineDataApi = () => axios.get("/data/rate.json")

// 获取任务进度饼图数据
export const getTaskDataApi = () => axios.get("/data/tarsk.json")